package cn.com.blueInfo.bpm.template.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 是否起草节点
 * @author suxch
 * @since 2025/8/28 22:53
 */
@Getter
@AllArgsConstructor
public enum ProcessNodeDraftFlag implements BaseEnum<Integer> {

    /** 是否起草节点-是 */
    IS_DRAFT_NODE(1, "是"),
    /** 是否起草节点-否 */
    NOT_DRAFT_NODE(0, "否");

    @EnumValue
    private final Integer code;

    @JsonValue
    private final String desc;

    public static ProcessNodeDraftFlag getByCode(Integer code) {
        return BaseEnum.getByCode(ProcessNodeDraftFlag.class, code);
    }

    @JsonCreator
    public static ProcessNodeDraftFlag getByName(String name) {
        return BaseEnum.getByName(name, ProcessNodeDraftFlag.class);
    }

}
